<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" href="${s.base}/mobile/base/css/base.css">
		<link rel="stylesheet" href="${s.base}/mobile/base/css/weui.min.css">
		<link rel="stylesheet" href="${s.base}/mobile/base/css/jquery-weui.css">
		<link rel="stylesheet" type="text/css" href="${s.base}/mobile/shaping/css/index.css"/>
		<style type="text/css">
			body,html{background: #fff;}
		</style>
	</head>
	<body>
		<div id="head_baner">
			<p>
				${webTagType.name}
			</p>
			<p>
				${webTagType.description}
			</p>
		</div>
		<div id="la_thired" style="white-space: nowrap;overflow-x: auto;">
			<#list webColumnList as webColumn>
				<#if webColumn_index == 0>
					<span data-id="${webColumn.id}" onclick="changeTag(this,'${webColumn.id}')" class="active_second">${webColumn.name}</span>
					<#else>
						<span data-id="${webColumn.id}" onclick="changeTag(this,'${webColumn.id}')">${webColumn.name}</span>
				</#if>
			</#list>

		</div>
		<div class="cut_100"></div>
		<div id="shop_list">


			
		</div>
	</body>
</html>
<script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script src="${s.base}/mobile/base/js/jquery-2.1.4.js" type="text/javascript" charset="utf-8"></script>
<script src="${s.base}/mobile/base/js/jquery-weui.js" type="text/javascript" charset="utf-8"></script>
<script src="${s.base}/mobile/base/js/swiper.js" type="text/javascript" charset="utf-8"></script>
<script src="${s.base}/mobile/shaping/js/window_port.js" type="text/javascript" charset="utf-8"></script>
<script src="${s.base}/mobile/base/js/component.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
    var userId='${webConfig.userId}';
    var colId='${colId}';
    var pageNum=0;
    var loading = false;  //状态标记
    var isEnd = false;//是否注销刷新
    var pageSize=5;
    $(document).ready(function(e) {
        initDate();
    });
    function initDate() {
        sendPost();
        initInfinite();
    }
    function  initInfinite() {
        $(document.body).infinite();
        $(document.body).infinite().on("infinite", function() {
            if(loading) return;
            loading = true;
            sendPost();
        });
    }
    function changeTag(obj,id) {
        $("#la_thired span").removeClass("active_second");
        $(obj).addClass("active_second");
        $("#shop_list").html("");
        colId=id;
        pageNum=0;
        if(isEnd){
            isEnd=false;
            initInfinite();
        }else{
            sendPost();
        }
    }
    function sendPost() {
        pageNum++;
        acceptXygProduct(colId,userId,pageNum,pageSize,function (result) {
            if (result.code == 0){
                if (result.data!=null && result.data.length > 0){
                    for(var i=0;i<result.data.length;i++){
                        var obj = result.data[i];
                        var content='<div class="cyt-xyg-item"><div class="shop_clock"><img src="'+obj.coverImage+'" alt="">'+
                            '<div class="shop_introduce"><div class="shop_introduce_1"  onclick="jumpProductPage(\''+obj.id+'\',\'${webConfig.id}\',\'productDesc\')">'+obj.name+'</div>'+
                        '<div class="shop_introduce_2"><div class="shop_introduce_2_left"><span class="pice_1" style="font-size:14px;">￥</span><span class="pice_1">'+obj.persentPrice+'</span>'+
                            '<span class="span_cut">￥'+obj.origPrice+'</span></div><div class="shop_introduce_2_right">已销售'+obj.saleNum+'</div></div></div></div><div class="cut_80"></div></div>';
                        $("#shop_list").append(content);
                        loading = false;
                        if(!result.hasNextPage){
                            isEnd=true;
                            $(document.body).destroyInfinite();
                        }
                    }
                }
            }
        });

    }
</script>